package com.ts.code.creator.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 参数类型： 无、id类、集合、分页、自定义
 */
@Getter
@AllArgsConstructor
public enum CreateFileEnum {
    ADMIN_CONTROLLER("无"),
    ADMIN_SERVICE("id类"),
    ADMIN_SERVICE_IMPL("分页"),
    ADMIN_PARAM("普通类"),
    ADMIN_VO("普通类"),
    PROVIDER_INTERFACE("普通类"),
    PROVIDER_REQDTO("普通类"),
    PROVIDER_RESPDTO("普通类"),
    SERVICE_CONTROLLER("普通类"),
    SERVICE_SERVICE("普通类"),
    SERVICE_SERVICE_IMPL("普通类");

    private String name;

    public static CreateFileEnum getByName(String name) {
        return Arrays.stream(CreateFileEnum.values()).filter(t -> t.getName().equals(name)).findAny().orElse(null);
    }

}
